const mongoose = require('mongoose')
const config = require('../config')

mongoose.connect(config.db, {}, (err) => {
  if (err) {
    return console.error(err)
  }
  console.log('链接成功')
})
require('./users')
require('./page')
require('./catalog')
require('./articles')
require('./images')
require('./goods')
require('./order')
require('./postage')
require('./dict')
require('./counters')

exports.Page = mongoose.model('Page')
exports.User = mongoose.model('User')
exports.Cart = mongoose.model('Cart')
exports.Address = mongoose.model('Address')
exports.Catalog = mongoose.model('Catalog')
exports.Article = mongoose.model('Article')
exports.Image = mongoose.model('Image')
exports.Goods = mongoose.model('Goods')
exports.Order = mongoose.model('Order')
exports.Postage = mongoose.model('Postage')
exports.Dict = mongoose.model('Dict')
exports.Counters = mongoose.model('Counters')
